package com.bw.exception;

import com.bw.domain.BResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class ExceptionController {


    @ExceptionHandler
    public BResult handler(Throwable throwable) {

        log.error("全局异常处理-----{}", throwable.getMessage());

        return BResult.error(throwable.getMessage());
    }

}
